package com.longtop.leaning.ui;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;

import com.longtop.leaning.business.DownloadThread;
import com.longtop.leaning.data.UIData;

public class DownloadForm extends Form implements CommandListener{

	private StringItem noteItem = null;
	
	public DownloadForm() {
		super("数据下载");
		noteItem = new StringItem ("","数据下载中。。。");
		this.append (noteItem);
		
		this.addCommand(UIData.CMD_BACK);
		this.setCommandListener(this);
		
		new DownloadThread(noteItem).run();
	}

	public void commandAction(Command c, Displayable d) {
		if(c == UIData.CMD_BACK){
			UIData.display.setCurrent(new FunctionList());
		}
	}
	
}
